<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include/include :: header('修改用户')" />
	<th:block th:include="include/include :: select2-css" />
	<style  type="text/css">
	/* .form-group .ie-placeholder{margin-left: 15px;} */
	.form-group .input-group-dept .ie-placeholder{margin-left:-15px;}
	</style>
</head>
<body>
    <div class="main-content main-user-edit">
        <form class="form-horizontal" id="editForm" th:action="@{/admin/user}" th:object="${viewobject}">
        	<input type="hidden" id="userId" th:field="*{userId}"/>
			<input type="hidden" name="oper" id="oper" th:value="${oper}"/>
			<input type="hidden" name="lockFlag" id="lockFlag"/>
			<input type="hidden" name="roleIds" id="roleIds"/>
			<input name="deptId"  type="hidden"  th:field="*{deptId}" id="treeId"/>
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">用户名：</label>
                        <div class="col-sm-8">
                            <input name="username" autocomplete="off" placeholder="请输入用户名" class="form-control" type="text" maxlength="30" th:field="*{username}" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">归属部门：</label>
                        <div class="col-sm-8">
                            <div class="input-group input-group-dept">
                                <input class="form-control form-control-dept" type="text" placeholder="请选择归属部门" name="deptName"  th:onclick="selectDeptTree()" id="treeName" th:field="*{deptName}" required>
                            	<span class="input-group-addon"><i class="fa fa-search"></i></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">手机号码：</label>
                        <div class="col-sm-8">
                            <input name="phone" id="phone" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phone}" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">邮箱：</label>
                        <div class="col-sm-8">
                            <input id="email" name="email" class="form-control email" type="text" maxlength="70" th:field="*{email}" placeholder="请输入邮箱" required>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">登录名：</label>
                        <div class="col-sm-8">
                            <input id="loginname" name="loginname" placeholder="请输入登录账号" class="form-control" type="text" th:field="*{loginname}" maxlength="30" th:readonly="${oper}!='add'" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" th:if="${oper}=='add'">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">登录密码：</label>
                        <div class="col-sm-8">
                            <input name="password" autocomplete="new-password" placeholder="请输入登录密码" class="form-control" type="password" maxlength="20" required>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">用户状态：</label>
                        <div class="col-sm-8">
                          	<label class="toggle-switch switch-solid" id="toggle-switch-normal">
	                            <input type="checkbox" id="status" th:checked="${viewobject.lockFlag == '9' ? false : true}">
	                            <span></span>
	                        </label>
	                       <!--  兼容ie8开关按钮样式 -->
	                        <i id="toggle-switch" class="toggle-switch switch-solid fa fa-toggle-on text-info fa-2x" style="display:none;cursor:pointer" th:data-checked="${viewobject.lockFlag == '9' ? false : true}"></i>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
            	<div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">角色：</label>
                        <div class="col-xs-10">
                            <label th:each="role:${allroles}" class="check-box">
								<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}">
							</label>
                        </div>
                    </div>
                </div>
            </div>
            <h4 class="form-header h4">其他信息</h4>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group normal-show-error">
                        <label class="col-xs-2 control-label">备注：</label>
                        <div class="col-xs-10">
                            <textarea name="remark" maxlength="200" class="form-control" rows="3">[[*{remark}]]</textarea>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
	<th:block th:include="include/include :: footer" />
	<th:block th:include="include/include :: select2-js" />
	<script th:src="@{/pages/sysadm/user/userEdit.js}"></script>
</body>
</html>